home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntlib43
/
mntlib
/
memchr.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-23
|
400b
|
28 lines
/* from Henry Spencer's stringlib */
#include <stddef.h>
#include <string.h>
/*
* memchr - search for a byte
*/
void *
memchr(s, ucharwanted, size)
const void * s;
int ucharwanted;
size_t size;
{
register const char *scan;
register size_t n;
scan = (const char *) s;
for (n = size; n > 0; n--)
if (*scan == (char) ucharwanted)
return((void *)scan);
else
scan++;
return(NULL);
}